home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacTech 1 to 12
/
MacTech-vol-1-12.toast
/
Tools
/
Alpha 6.51b13 ƒ
/
Tcl
/
SystemCode
/
browser.tcl
< prev
next >
Wrap
Text File
|
1996-08-15
|
1KB
|
52 lines
#=============================================================================
# Browser mode.
#=============================================================================
proc dummyBrws {} {}
proc upBrowse {} {
set limit [nextLineStart [nextLineStart 0]]
if {[getPos] > $limit} {
set limit [expr [getPos] - 1]
}
select [lineStart $limit] [nextLineStart $limit]
}
proc downBrowse {} {
set pos [getPos]
if {$pos < [nextLineStart 0]} {
set pos [nextLineStart 0]
}
if {[nextLineStart $pos] != [maxPos]} {
select [nextLineStart $pos] [nextLineStart [nextLineStart $pos]]
}
}
proc nextMatch {{wname "*Batch Find*"}} {
set wins [winNames]
set res [lsearch $wins $wname]
if {$res < 0} {
set res [lsearch -regexp $wins {\*.*\*}]
if {$res < 0} return
}
set win [lindex $wins $res]
bringToFront $win
downBrowse
gotoMatch
dispErr $win
}
bind '\r' gotoMatch Brws
bind enter gotoMatch Brws
ascii 0x3 gotoMatch Brws
bind down downBrowse Brws
bind up upBrowse Brws
bind 'n' <z> downBrowse Brws
bind 'p' <z> upBrowse Brws
ascii 0x20 downBrowse Brws
ascii 0x8 upBrowse Brws